<!DOCTYPE HTML>
<!-- <no_layout name="Layout\layout" />  -->
	<style type="text/css">
	@media(max-width:991px){
		.mydiscussion{
		margin:1.5em 0;
		}
	}
	.compose-left ul li .discussionLine {
		display: block;
		font-size: 1em;
		color: #555;
		border-bottom: 1px solid #DCDCDC;
		padding: 0.3em 1.5em;
	}
	.compose-left ul li .discussionLine:hover {
		background-color: rgb(241, 241, 241);
	}
	.profile-btm ul li {
    display: inline-block;
    width: 23%;
    text-align: center;
    padding: 1.35em 0;
	}
	</style>
	<!--left-fixed -navigation-->
	<div class="elements  row">
		<div class="col-md-4 profile widget-shadow card pressthis">
			<h4 class="title3">Profile</h4>
			<div class="profile-top">
				<img src="__PUBLIC__/images/a.png" alt="">
				<h4>{$informa.username}</h4>
				<h5>{$informa.number}-{$informa.class}</h5>
			</div>
			<div class="profile-text">
				<div class="profile-row">
					<div class="profile-left">
						<i class="fa fa-envelope profile-icon"></i>
					</div>
					<div class="profile-right">
						<h4>Username@example.com </h4>
						<p>Email</p>
					</div> 
					<div class="clearfix"> </div>	
				</div>
				<div class="profile-row row-middle">
					<div class="profile-left">
						<i class="fa fa-mobile profile-icon"></i>
					</div>
					<div class="profile-right">
						<h4>222-555-111</h4>
						<p>Contact Number</p>
					</div> 
					<div class="clearfix"> </div>	
				</div>
				<!-- <div class="profile-row">
					<div class="profile-left">
						<i class="fa fa-facebook profile-icon"></i>
					</div>
					<div class="profile-right">
						<h4>facebook.com/user</h4>
						<p>Facebook</p>
					</div> 
					<div class="clearfix"> </div>	
				</div> -->
			</div>
			<div class="profile-btm" >
				<ul>
					<li>
						<h4>{$randomnum}</h4>
						<h5>随机练习</h5>
					</li>
					<li>
						<h4>1</h4>
						<h5>小组排名</h5>
					</li>
					<li>
						<h4>{$inclassnum}</h4>
						<h5>随堂练习</h5>
					</li>
					<li>
						<h4>60</h4>
						<h5>作业上传</h5>
					</li>
				</ul>
			</div>
		</div>
		<div class="col-md-4 profile chat-mdl-grid card pressthis">
		<div class="col-md-4 compose-left" style = "width:100%;">
			<div class="chat-grid widget-shadow" style="margin-top:0em;">
				<ul>
					<li class="head" id="teamNameTitle" style="font-size: 1.2em;">未加入小组</li>
					
					<li id="li_logout" style="font-size: 1.2em;"><a data-toggle="modal" data-target="#logoutTeam" data-whatever="@mdo" id="a_logout"><i class="fa fa-inbox"></i>退出小组 </a>
						<div class="modal fade card pressthis" id="logoutTeam" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" style="display:none;">
							<div class="modal-dialog" role="document">
								<div class="modal-content">
									<div class="modal-header">
										<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
										<h4 class="modal-title" id="exampleModalLabel">警告</h4>
									</div>
									<div class="modal-body">
										<form>
											<div class="form-group">
												<label for="isLogout" id = "isLogout" class="control-label" >是否退出小组？</label>
											</div>														
										</form>
									</div>
									<div class="modal-footer" id="b_isLogout">
										<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
										<button type="button" class="btn  btn-primary" id="logout">退出</button>
									</div>
								</div>
							</div>
						</div>
						<script>
							$("#a_logout").click(function(){
								$("#logoutTeam").toggle();
							})
							$("#logout").click(function(){
								$.ajax({
									cache:false,
									type:"POST",
									async:false,
									//contentType:
									url:"{:U('Team/logoutTeam')}",
									dataType:"json",
									data: "openid={$openid}",
									timeout:30000,
									error:function(XMLHttpRequest, textStatus,errorThrown){                      
										return false;
									},
									success:function(jsApiParameters){
										if(jsApiParameters!=1) {alert(jsApiParameters);return false;}					
										$('#isLogout').html("退出成功!");
										//sleep(3);
										setTimeout(function(){$("#logoutTeam").modal('hide');},1000);
										$("#b_isLogout").hide();
										window.location.reload(true);			
									}
								});					
							});											
						</script>
						
					</li>
					<li id="li_join" style="font-size: 1.2em;"><a data-toggle="modal" data-target="#joinTeam" data-whatever="@mdo"><i class="fa fa fa-envelope-o"></i>加入小组 </a>
						<div class="modal fade card pressthis" id="joinTeam" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
							<div class="modal-dialog" role="document">
								<div class="modal-content">
									<div class="modal-header">
										<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
										<h4 class="modal-title" id="exampleModalLabel">加入小组</h4>
									</div>
									<div class="modal-body" id="divJoin" style="text-align:center">
										<form class="form-horizontal">
											<div class="form-group" >
												<label for="teamname" class="col-sm-2 control-label" >组名:</label>
												<!-- <input type="text" class="form-control" id="teamname" > -->
												<div class="col-sm-10">
													<select name="teamname" id="teamname" class="form-control1">																
														<option selected="true" value="">选择你的组...</option>
														<volist name="teamnames" id="vp">
														<option value="{$vp.teamname}">{$vp.teamname} </option>
														</volist>
													</select>
												</div>
											</div>
											<div class="form-group">
												<label for="passwd" class="col-sm-2 control-label" >口令:</label>
												<div class="col-sm-10" >
													<input type="text" class="form-control" id="passwd">
												</div>
											</div>
										</form>
									</div>
									<div class="modal-footer" id="b_join">
										<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
										<button type="button" class="btn btn-primary" id="join">加入</button>
									</div>
								</div>
							</div>
						</div>
						<script>
							$("#join").click(function(){
								if($('#teamname').val() == ""){
									alert("Please select one team!");
									return false;
								}
								var ajaxData ={};
								ajaxData['teamname'] = $('#teamname').val();											
								ajaxData['passwd']   = $('#passwd').val();	
								ajaxData['openid'] = $('#openid').val();											
								$.ajax({
									cache:false,
									type:"POST",
									async:false,
									//contentType:
									url:"{:U('Team/joinTeam')}",
									dataType:"json",
									data: ajaxData,
									timeout:30000,
									error:function(XMLHttpRequest, textStatus,errorThrown){                      
										return false;
									},
									success:function(jsApiParameters){
										if(jsApiParameters!=1) {alert(jsApiParameters);return false;}																																																																	
										$('#divJoin').html("加入成功!!");
										//sleep(3);
										setTimeout(function(){$("#joinTeam").modal('hide');},1000);
										$("#b_join").hide();
										window.location.reload(true);													
									}
								});					
							});										
						</script>									
					</li>
					
					<li id="li_deliver" style="font-size: 1.2em;"><a data-toggle="modal" data-target="#deliverDiscussion" data-whatever="@mdo" id="a_deliver"><i class="fa fa-file-text-o nav_icon"></i>讨论报告 </a> 
						<div class="modal fade card pressthis" id="deliverDiscussion" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" style="display:none;">
							<div class="modal-dialog" role="document">
								<div class="modal-content">
									<div class="modal-header">
										<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
										<h4 class="modal-title" id="exampleModalLabel">提交报告</h4>
									</div>
									<form action="__URL__/upload?savePath=/Discussion/"  method="post" enctype="multipart/form-data">  <!-- 要使用上传功能 你的表单需要设置 enctype="multipart/form-data" -->
										<div class="modal-body" id="divDeliver">
											
												<div class="form-group" >
													<label for="recipient-name" class="control-label"></label>
													<div class="col-lg-10">
													<select name="discussionNum" id="discussionNum" class="form-control1">																
														<option selected="true" value="">请选择任务...</option>
														<option value="test1">Dolore, ab unde modi est!</option>																
													</select>
													</div>
												</div>
												<div class="form-group" >
													<label for="message-text" class="control-label"></label>
														<div class="col-md-8 compose-right " style="">																																					
															<div class="btn btn-default btn-file">
																<i class="fa fa-paperclip"></i> 选择文件
																<input type="file" name="discussionFile" onchange="$('#filenotice').html($('[name=discussionFile]').val());	"/>
																<div class="showFileName"></div>
																<div class="fileerrorTip"></div>
															</div>
															<p class="help-block" id="filenotice">Max. 3MB</p>																														
														</div>
												</div>														
										</div>
										<div class="modal-footer" id="b_isCreate">									
											<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
											<button type="submit" class="btn btn-primary" id="deliver" >提交</button>
										</div>
										<input name="teamname" id="teamname" value="{$teamname}" type="hidden"  />
										<input name="openid" id="openid" value="{$openid}" type="hidden"  />
									</form>
								</div>
							</div>
						</div>
					</li>
					
				</ul>
			</div>
			<script type="text/javascript">
				$("#a_deliver").click(function(){
								$("#deliverDiscussion").toggle();
							})
			</script>
			<div class="chat-grid widget-shadow" id="div_teammate">
				<!-- <table class="widefat wp-list-table"> -->
					<!-- <thead> -->
					
					<ul>
						<li class="head" style="font-size: 1.2em;">我的组员 (Online) </li>
						
						<volist name="class" id="vo">												
							<!-- <th> -->
							<li style="display: block;box-sizing: border-box;"><a href="#" style="border-bottom: 1px solid #DCDCDC;display: block;">
									<div class="chat-left" style="float: left;">
										<img class="img-circle" src="images/i1.png" alt="">
										<label class="small-badge"></label>
									</div>
									<div class="chat-right" style="float: left;">
										<p>{$vo.username}</p>
										<h6>{$vo.class}</h6>
									</div>
									<div class="clearfix" style="    display: table;    content: ' ';clear: both;"> </div>	
								</a>
							</li>
							<!-- </th>												 -->
						</volist>
						
						<!-- <li><a href="#">
								<div class="chat-left">
									<img class="img-circle" src="images/i2.png" alt="">
									<label class="small-badge bg-green"></label>
								</div>
								<div class="chat-right">
									<p>Justen Ferry</p>
									<h6>Urna mollis ornare vel</h6>
								</div>
								<div class="clearfix"> </div>	
							</a>
						</li> -->
						
					</ul>
					<!-- </thead> -->
				<!-- </table> -->
			</div>
			
			
			
			
		</div>
		</div>
		<div class="col-md-4 profile card pressthis">
			<div class="col-md-4 compose-left mydiscussion" style="width:100%;">
				<div class=" chat-grid widget-shadow" id="div_discussion" style="margin-top:0em;">
					<ul>
						<li class="head">我们的讨论报告 <span>{$discussioncount}</span></li>
						<volist name="discussion" id="vo1">
							<li>
							
								<div class="discussionLine">
							<!-- -->
									<div class="chat-left" style="font-size:1.3em;width:18%;color:#3CB371;">
										<i class="fa fa-envelope-o"></i>
									</div>
									<div class="chat-right padding-5 col-sm-6" style="float:left;margin-bottom:1px;font-size:1.2em;">
										<p>{$vo1.discussionnum}</p>
										
										
									</div>
									<div class=" col-md-10" style="padding-left:0px" id="evaluate_{$i}">
										<h5>评价：{$vo1.evaluate}</h5>
									</div>
									
									<!-- <div class="chat-right" style="width:18%">									
										<img src="__PUBLIC__/images/download.png"  alt="download" width="100%" height="100%"/>									
									</div> -->
									<div class="mail-right">
										<div class="dropdown">
											<a href="#"  data-toggle="dropdown" aria-expanded="false"   style="border-bottom:0px">
												<p><i class="fa fa-ellipsis-v mail-icon"></i></p>
											</a>
											<ul class="dropdown-menu float-right">
												<!-- <li>
													<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
														<i class="fa fa-reply mail-icon"></i>
														Reply
													</a>
												</li> -->
												<li>
													<a href="__UPLOAD__{$vo1.filesavename}" title="">
														<i class="fa fa-download mail-icon"></i>
														Archive
													</a>
												</li>
												<!-- <li>
													<a href="#" class="font-red" title="">
														<i class="fa fa-trash-o mail-icon"></i>
														Delete
													</a>
												</li> -->
											</ul>
										</div> 
									</div>

									<div class="clearfix"> </div>	
								</div>
							</li>
						<script type="text/javascript">
						if($("#evaluate_{$i} h5").html() == "评价："){
							$("#evaluate_{$i}").hide();
						}
						//alert($("#evaluate_{$i}").html());
						</script>
						</volist>										
					</ul>
				</div>
			</div>
		</div>
		
		
		<div class="clearfix"> </div>	
	</div>


	<input name="openid" id="openid" value="{$openid}" type="hidden"  />
		<!-- main content end-->		
		
	<script>
		var	answer ="no";		
		if('{$teamname}' !== '0'){
			$("#teamNameTitle").html('组名：{$teamname}');
			$("#li_join").hide();
			$("#li_create").hide();												
		}else{
			$("#li_logout").hide();
			$("#div_teammate").hide();
			$("#div_discussion").hide();
			$("#li_deliver").hide();				
		}
		
		//console.log('对象：',obj1);													
	</script>
	